1. Field of the Invention
The field of the invention is data processing, or, more specifically, methods, apparatuses, and computer program products for dynamically determining a primary or slave assignment based on an order of cable connection between two devices.
2. Description of Related Art
In a primary/slave model of communication, one device or process has unidirectional control over one or more of the other devices. In some systems, a primary device is elected from a group of eligible devices with the other devices acting in the role of slaves. The standard Universal Serial Bus (USB) specification is an example of a primary/slave architecture in which the USB host (also known as a primary device) acts as the protocol master and a USB device acts as a peripheral device (also known as a slave device). According to the USB specification, only the primary device can schedule the configuration and data transfers over the link. The USB slave devices cannot initiate data transfers, they only respond to requests given by the primary device. In the USB On-The-Go (USB OTG) specification, USB devices such as digital audio players or mobile phones may also act as a primary device that hosts another USB device. That is, USB OTG enables a USB device to perform both the primary device and slave device roles. The default link configuration is that the device connected to the ‘A’ end of the cable (known as A-device) acts as the USB host and the device coupled to the ‘B’ end of the cable (known as B-device) acts as the USB Peripheral device. That is, the A-device acts as the primary device, while the B-device acts as the slave device. The OTG A-device is a power supplier and an OTG B-device is a power consumer. If a user connects the A and B devices in the wrong direction for the task they want to perform, the USB OTG specification includes protocols that enable the devices to switch roles. That is, devices using this protocol rely on additional configuration transfers between the devices to determine which device will act as primary device and which will act as a slave device. In a datacenter with hundreds or even thousands of cables and devices with limited device user interfaces, it may be difficult for an administrator to determine if the devices are coupled correctly.